<?php
// Set your connection info here
mysql_connect(h,u,p)or die(mysql_error());
mysql_select_db(d)or die(mysql_error());

$sSQL = query("SELECT * FROM ".tSettings."");
$settings = mysql_fetch_object($sSQL);

// Check if custom page exists, if not use Default Page
if(isset($_GET['id']))
{
    define('id', $_GET['id']);
}
else
{
    define('id', $settings->default_page);
}

$tSQL  = query("SELECT template FROM ".tPages." WHERE id = '".sql(id)."'");
$tList = mysql_fetch_object($tSQL);

// Check if the Page has a template set, if not use default otherwise use custom one
if($tList->template == 'Default' || $tList->template == '')
{
    $template1 = $settings->default_template;
}
else
{
    $template1 = $tList->template;
}

$template2 = 'templates/'.$template1.'.tpl';

$sectionList = getSections($template2);

// Random Secure Key for BlowFish Encryption.
define('setKey', 'QSV1rgh1vx2pewLsRA5FLbU3D9OtpvWsaHtwVxWenirEJZ5THCtSYTTAAXwK78n'); // CHANGE PER LIVE SITE

// Salt for blowfish passwords. Similar to above, may not be the same
define('salt', 'b');
define('hash', strGen(32));
